import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {
  // public searchQuery: string = '';
  public items=[];
  public widthLength='';

  constructor(public navCtrl: NavController) {
      this.initializeItems();
  }

  initializeItems() {
    // this.items = [
    //   'Amsterdam',
    //   'Bogota',
    //   'cmsterdam',
    //   'Andy',
    //   'Ams',
    //   'daddd'
    // ];
    for(var i=0;i<8;i++){
      this.items.push({pic:'assets/imgs/0'+i+'.jpg',
                title:'第'+i+'数据'});
    }
    this.widthLength=this.items.length*90+'px';
  }

  myInput(){
    // console.log("================你好");
  }

  getItems(ev: any) {
    // console.log("================2");
    // Reset items back to all of the items
    // this.initializeItems();

    // set val to the value of the searchbar
    // const val = ev.target.value;

    // if the value is an empty string don't filter the items
    // if (val && val.trim() != '') {
    //   this.items = this.items.filter((item) => {
    //     return (item.toLowerCase().indexOf(val.toLowerCase()) > -1);
    //   })
    // }
  }

}
